import React, { Component } from 'react'
import { connect } from 'dva';
import { Tabs } from 'antd';
import { checkInit } from '@/utils/util';

import Tasks from './Task';
import Report from './report';

const TabPane = Tabs.TabPane;

interface IProps {
  dispatch?: Function
}

@connect()
class index extends Component<IProps> {

  componentDidMount() {
    checkInit();
  }

  callback = (key) => {
    sessionStorage.setItem('def_key', key);
  };
  onChange = (key) => {
    sessionStorage.setItem('def_key', key);
  };

  render() {

    return (
      <>
        <Tabs onChange={this.callback} defaultActiveKey="1">
          <TabPane tab="生成巡查任务" key="1">
            <Tasks />
          </TabPane>
          <TabPane tab="查看巡查报告" key="2">
            <Report />
          </TabPane>
        </Tabs>
        
      </>
    )
  }
}

export default index;
